Integrand size = 29, antiderivative size = 104 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {a x}{b^2}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d} \]
[Out]
Time = 0.21 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2973, 3136, 2739, 632, 210, 3855} \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {a x}{b^2}-\frac {\cot (c+d x)}{a d}-\frac {\cos (c+d x)}{b d} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2973
Rule 3136
Rule 3855
Rubi steps \begin{align*} \text {integral}& = -\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d}-\frac {\int \frac {\csc (c+d x) \left (b^2+2 a b \sin (c+d x)+a^2 \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{a b} \\ & = -\frac {a x}{b^2}-\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d}-\frac {b \int \csc (c+d x) \, dx}{a^2}+\frac {\left (a^2-b^2\right )^2 \int \frac {1}{a+b \sin (c+d x)} \, dx}{a^2 b^2} \\ & = -\frac {a x}{b^2}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d}+\frac {\left (2 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 b^2 d} \\ & = -\frac {a x}{b^2}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d}-\frac {\left (4 \left (a^2-b^2\right )^2\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 b^2 d} \\ & = -\frac {a x}{b^2}+\frac {2 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {b \text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cos (c+d x)}{b d}-\frac {\cot (c+d x)}{a d} \\ \end{align*}
Time = 0.91 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.40 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {2 a^3 c+2 a^3 d x-4 \left (a^2-b^2\right )^{3/2} \arctan \left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )+2 a^2 b \cos (c+d x)+a b^2 \cot \left (\frac {1}{2} (c+d x)\right )-2 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+2 b^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-a b^2 \tan \left (\frac {1}{2} (c+d x)\right )}{2 a^2 b^2 d} \]
[In]
[Out]
Time = 1.32 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.49
method | result | size |
derivativedivides | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {1}{2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 \left (\frac {b}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{b^{2}}+\frac {\left (4 a^{4}-8 a^{2} b^{2}+4 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 a^{2} b^{2} \sqrt {a^{2}-b^{2}}}}{d}\) | \(155\) |
default | \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}-\frac {1}{2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}-\frac {2 \left (\frac {b}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+a \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )}{b^{2}}+\frac {\left (4 a^{4}-8 a^{2} b^{2}+4 b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{2 a^{2} b^{2} \sqrt {a^{2}-b^{2}}}}{d}\) | \(155\) |
risch | \(-\frac {a x}{b^{2}}-\frac {{\mathrm e}^{i \left (d x +c \right )}}{2 b d}-\frac {{\mathrm e}^{-i \left (d x +c \right )}}{2 b d}-\frac {2 i}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a^{2} d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a^{2} d}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,a^{2}}+\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a +\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}-\frac {\sqrt {-a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a +\sqrt {-a^{2}+b^{2}}}{b}\right )}{d \,a^{2}}\) | \(308\) |
[In]
[Out]
none
Time = 0.36 (sec) , antiderivative size = 396, normalized size of antiderivative = 3.81 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\left [\frac {b^{3} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - b^{3} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, a b^{2} \cos \left (d x + c\right ) - {\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) \sin \left (d x + c\right ) - 2 \, {\left (a^{3} d x + a^{2} b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, a^{2} b^{2} d \sin \left (d x + c\right )}, \frac {b^{3} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - b^{3} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 2 \, a b^{2} \cos \left (d x + c\right ) - 2 \, {\left (a^{2} - b^{2}\right )}^{\frac {3}{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 2 \, {\left (a^{3} d x + a^{2} b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, a^{2} b^{2} d \sin \left (d x + c\right )}\right ] \]
[In]
[Out]
\[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\cos ^{2}{\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (99) = 198\).
Time = 0.38 (sec) , antiderivative size = 221, normalized size of antiderivative = 2.12 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\frac {6 \, {\left (d x + c\right )} a}{b^{2}} + \frac {6 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} - \frac {3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} - \frac {12 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{2} b^{2}} - \frac {2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )} a^{2} b}}{6 \, d} \]
[In]
[Out]
Time = 8.14 (sec) , antiderivative size = 1167, normalized size of antiderivative = 11.22 \[ \int \frac {\cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]